﻿<Window x:Class="AlertWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title=""  ShowInTaskbar="False"
    Width="310" Height="150"  WindowStyle="None"  
    ShowActivated="False" Visibility="Collapsed"
    Background="Transparent"
    Topmost="True" AllowsTransparency="True" ResizeMode="NoResize">

    <Window.Resources>
        <ControlTemplate x:Key="CloseButtonTemplate" TargetType="{x:Type Button}">
            <Grid Background="Transparent">
                <Viewbox>
                    <ContentPresenter/>
                </Viewbox>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="BitmapEffect">
                        <Setter.Value>
                            <OuterGlowBitmapEffect GlowSize="12" GlowColor="White"/>
                        </Setter.Value>
                    </Setter>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="BitmapEffect">
                        <Setter.Value>
                            <OuterGlowBitmapEffect GlowSize="12" GlowColor="DarkGray"/>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Window.Resources>

    <Border CornerRadius="5" 
                BorderThickness="1"
                Width="300" Height="140">
        <Border.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5">
                <GradientStop Color="#B6CADF" Offset="0" />
                <GradientStop Color="#E8F0FF" Offset="0.3" />
            </LinearGradientBrush>
        </Border.Background>
        <Border.BorderBrush>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                <GradientStop Color="Gray" Offset="0" />
                <GradientStop Color="#333333" Offset="1" />
            </LinearGradientBrush>
        </Border.BorderBrush>
        <Border.BitmapEffect>
            <DropShadowBitmapEffect Softness=".3" ShadowDepth="3" Color="Gray"/>
        </Border.BitmapEffect>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid Margin="3" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Image Margin="3 0 0 0" Source="http://live.nicovideo.jp/img/favicon.ico" Width="16" Height="16" VerticalAlignment="Center" />

                <TextBlock Margin="5 3 0 0"
                               Grid.Column="1"
                               Cursor="Hand" 
                               Text="{Binding Path=Title}" 
                               VerticalAlignment="Bottom">
                </TextBlock>

                <Button Grid.Column="2"
                            Margin="0 0 3 0" VerticalAlignment="Center" Width="16" Height="16">
                    <Button.Resources>
                        <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0" Opacity="0.5">
                            <GradientStop Color="#F3F3F3" Offset="0"/>
                            <GradientStop Color="#EBEBEB" Offset="0.5"/>
                            <GradientStop Color="#DDDDDD" Offset="0.5"/>
                            <GradientStop Color="#CDCDCD" Offset="1"/>
                        </LinearGradientBrush>
                        <LinearGradientBrush x:Key="ButtonOverBackground" EndPoint="0,1" StartPoint="0,0" Opacity="0.5">
                            <GradientStop Color="#FFFAFAFA" Offset="0"/>
                            <GradientStop Color="#FFE0E0E3" Offset="1"/>
                        </LinearGradientBrush>
                        <LinearGradientBrush x:Key="ButtonPressedBackground" EndPoint="0,1" StartPoint="0,0" Opacity="0.5">
                            <GradientStop Color="#FFE0E0E2" Offset="0"/>
                            <GradientStop Color="#FFF8F8F8" Offset="1"/>
                        </LinearGradientBrush>
                        <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF969696" Opacity="0.5" />
                    </Button.Resources>


                    <Button.Style>
                        <Style TargetType="{x:Type Button}">
                            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                            <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
                            <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
                            <Setter Property="BorderThickness" Value="1"/>
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            <Setter Property="HorizontalContentAlignment" Value="Center"/>
                            <Setter Property="VerticalContentAlignment" Value="Center"/>
                            <Setter Property="Padding" Value="4"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Button}">
                                        <Grid>

                                            <Border SnapsToDevicePixels="True" x:Name="Chrome" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Opacity="0" />
                                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
                                            <Path x:Name="Path" Stretch="Fill" StrokeThickness="0.5" 
                                                      Stroke="#FF333333" Fill="#FF969696" 
                                                      Data="F1 M 2.28484e-007,1.33331L 1.33333,0L 4.00001,2.66669L 6.66667,6.10352e-005L 8,1.33331L 5.33334,4L 8,6.66669L 6.66667,8L 4,5.33331L 1.33333,8L 1.086e-007,6.66669L 2.66667,4L 2.28484e-007,1.33331 Z " 
                                                      HorizontalAlignment="Center" VerticalAlignment="Center"
                                                      Width="10" Height="10" />

                                        </Grid>
                                        <ControlTemplate.Triggers>
                                            <EventTrigger RoutedEvent="Mouse.MouseEnter">
                                                <EventTrigger.Actions>
                                                    <BeginStoryboard >
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetName="Chrome"
                                                                     Storyboard.TargetProperty="Opacity"
                                                                     From="0" To="1.0" Duration="0:0:0.3" />
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </EventTrigger.Actions>
                                            </EventTrigger>

                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter Property="Opacity" TargetName="Chrome" Value="1"/>
                                                <Setter Property="Background" TargetName="Chrome" Value="{DynamicResource ButtonOverBackground}" />
                                                <Setter Property="Fill" TargetName="Path" Value="#FFB83C3D"/>
                                            </Trigger>

                                            <EventTrigger RoutedEvent="Mouse.MouseLeave">
                                                <EventTrigger.Actions>
                                                    <BeginStoryboard >
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetName="Chrome"
                                                                     Storyboard.TargetProperty="Opacity"
                                                                     From="1.0" To="0" Duration="0:0:0.3" />
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </EventTrigger.Actions>
                                            </EventTrigger>

                                            <Trigger Property="IsPressed" Value="True">

                                                <Setter Property="Opacity" TargetName="Chrome" Value="1"/>
                                                <Setter Property="Background" TargetName="Chrome" Value="{DynamicResource ButtonPressedBackground}" />
                                            </Trigger>
                                            <Trigger Property="IsEnabled" Value="false">
                                                <Setter Property="Foreground" Value="#ADADAD"/>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </Button.Style>
                </Button>
            </Grid>

            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <StackPanel>
                    <Image 
                            Width="96" Height="96" Margin="8 5 5 5" 
                            HorizontalAlignment="Left"
                            Source="{Binding Path=IconUri}"
                            Cursor="Hand">
                        <Image.BitmapEffect>
                            <DropShadowBitmapEffect Softness=".5" ShadowDepth="3" Color="Gray"/>
                        </Image.BitmapEffect>
                    </Image>
                </StackPanel>

                <Grid Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <TextBlock  TextWrapping="Wrap" Foreground="#333" 
                                    Text="{Binding Path=Body}"
                                    Margin="5 0 5 0"
                                    ScrollViewer.VerticalScrollBarVisibility="Auto" />
                    <Grid Grid.Row="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <TextBlock Padding="1" Margin="5 0 0 0"  Foreground="#333" Text="{Binding Path=FooterLeft}" VerticalAlignment="Center" />
                        <StackPanel Margin="0 0 5 0" 
                                        Orientation="Horizontal" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" >
                            <TextBlock Padding="1" Foreground="#333" Text="{Binding Path=FooterRight}" VerticalAlignment="Center" />
                        </StackPanel>
                    </Grid>

                </Grid>
            </Grid>
        </Grid>
    </Border>
</Window>
